package com.alstudio.utils.android.net.download;

import java.io.File;
import java.io.RandomAccessFile;
import java.net.URL;

public class ALHttpDownLoadInfo {

	private URL URL;
	private File file;
	private String url;
	private Throwable exception;
	private RandomAccessFile outputStream;

	private long downloadSize;
	private long previousFileSize;
	private long totalSize;
	private long downloadPercent;
	private long networkSpeed; // 网速
	private long previousTime;
	private long totalTime;
	private boolean interrupt = false;

	public final static int TIME_OUT = 30000;
	private final static int BUFFER_SIZE = 1024 * 8;

	public enum HttpDownloadErrorCode {
		// 下载成功
		AL_HTTP_DOWNLOAD_TYPE_ERROR_NONE,
		// 未挂载外部存储器
		AL_HTTP_DOWNLOAD_TYPE_ERROR_NO_EXTENAL_STORAGE,
		// SD卡空间不足
		AL_HTTP_DOWNLOAD_TYPE_ERROR_EXTENAL_STORAGE_OUT_OF_RANGE,
		// 网络不可用
		AL_HTTP_DOWNLOAD_TYPE_ERROR_NO_INTENET_CONNECTION,
		// 超时
		AL_HTTP_DOWNLOAD_TYPE_ERROR_TIME_OUT,
		// 未知错误
		AL_HTTP_DOWNLOAD_TYPE_ERROR_UNKONW,
	}
}
